package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.teaching.vo.YaStudentScoreVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.YaWeeklyReportsMapper;
import com.ruoyi.teaching.domain.YaWeeklyReports;
import com.ruoyi.teaching.service.IYaWeeklyReportsService;

/**
 * 周报Service业务层处理
 * 
 * @author ZBX
 * @date 2025-03-14
 */
@Service
public class YaWeeklyReportsServiceImpl implements IYaWeeklyReportsService 
{
    @Autowired
    private YaWeeklyReportsMapper yaWeeklyReportsMapper;

    /**
     * 查询周报
     * 
     * @param id 周报主键
     * @return 周报
     */
    @Override
    public YaWeeklyReports selectYaWeeklyReportsById(Long id)
    {
        return yaWeeklyReportsMapper.selectYaWeeklyReportsById(id);
    }

    /**
     * 查询周报列表
     * 
     * @param yaWeeklyReports 周报
     * @return 周报
     */
    @Override
    public List<YaWeeklyReports> selectYaWeeklyReportsList(YaWeeklyReports yaWeeklyReports)
    {
        return yaWeeklyReportsMapper.selectYaWeeklyReportsList(yaWeeklyReports);
    }

    /**
     * 新增周报
     * 
     * @param yaWeeklyReports 周报
     * @return 结果
     */
    @Override
    public int insertYaWeeklyReports(YaWeeklyReports yaWeeklyReports)
    {
        yaWeeklyReports.setCreateTime(DateUtils.getNowDate());
        return yaWeeklyReportsMapper.insertYaWeeklyReports(yaWeeklyReports);
    }

    /**
     * 修改周报
     * 
     * @param yaWeeklyReports 周报
     * @return 结果
     */
    @Override
    public int updateYaWeeklyReports(YaWeeklyReports yaWeeklyReports)
    {
        yaWeeklyReports.setUpdateTime(DateUtils.getNowDate());
        return yaWeeklyReportsMapper.updateYaWeeklyReports(yaWeeklyReports);
    }

    /**
     * 批量删除周报
     * 
     * @param ids 需要删除的周报主键
     * @return 结果
     */
    @Override
    public int deleteYaWeeklyReportsByIds(Long[] ids)
    {
        return yaWeeklyReportsMapper.deleteYaWeeklyReportsByIds(ids);
    }

    /**
     * 删除周报信息
     * 
     * @param id 周报主键
     * @return 结果
     */
    @Override
    public int deleteYaWeeklyReportsById(Long id)
    {
        return yaWeeklyReportsMapper.deleteYaWeeklyReportsById(id);
    }

    @Override
    public int batchInsert(List<YaStudentScoreVo> yaStudentScoreVo) {
        return yaWeeklyReportsMapper.batchInsert(yaStudentScoreVo);
    }

    @Override
    public int deleteStudentScore(Long reportId) {
        return yaWeeklyReportsMapper.deleteStudentScore(reportId);
    }

    @Override
    public List<YaStudentScoreVo> getStudentScore(Long reportId) {
        return yaWeeklyReportsMapper.getStudentScore(reportId);
    }
}
